<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<script type="text/javascript" src="./js/jquery-1.4.4.min.js"></script>	
	<script language="javascript" src="./js/district.js" charset="UTF-8"></script>
	
	<style type="text/css">
		*{
			margin:0px;
			padding:0px;
		}
		.top{
			width:100%; 
			height:35px; 
			line-height:35px; 
			font-size:12px;	
		}
		.top ul li{
			list-style:none;
			float:right;
			width:46px;
		}
		a{
			color:#06F;
			text-decoration:none;
		}
		a:hover{
			text-decoration:underline;
		}
		table tr{
			height: 42px;
		}
		.addupload{
			background:#0C9; 
			width:60px; 
			height:20px; 
			border:none; 
			color:#FFF;
			border-radius:5px;
		}
		.delupload{
			background:red; 
			width:60px; 
			height:20px; 
			border:none; 
			color:#FFF;
			border-radius:5px;
		}
	</style>
</head>

<body>
	<div style="height:35px; width:100%; border-bottom:1px solid #CCC; z-index:-1; position:absolute; background:#EFEFEF;"></div>
	<div style="width:1200px; margin:auto;">
		<!-- 顶部索引 -->
        <div class="top">
        	<div style="width:50%; float:left;">你好！欢迎进入中国报险网。</div>
            <div style="width:50%; float:right; text-align:right;">
				<jsp:include page="case_top.jsp"></jsp:include>
            </div>
        </div>
        <!-- 主体内容 -->
        <div style="width:100%; float:left; font-family: '微软雅黑' ">
            <div style="width: 1000px; margin:38px 120px;">       
				<div style="width: 1000px; height: 60px; background: #0C9; border-top-left-radius: 10px; border-top-right-radius: 10px; text-align: center; line-height: 60px; color: #FFF;">报险信息</div>
				<div style="border: 1px solid #CCC;">					
					<!-- 添加案件信息 -->
					<form action="${pageContext.request.contextPath }/cases/Case_addcase.action" enctype="multipart/form-data" method="post" onSubmit="return checkAll()">
						<input type="hidden" name="cida" value="${Customer.cid }"/>
						<table border="0px" align="center" width="100%" cellspacing="0px">
							<tr>
								<td colspan="2">&nbsp;报险人：${Customer.cname }</td>
							</tr>
							<tr>
								<td align="right" width="20%">请选择接案人员：</td>
								<td width="80%">
									<div>
										&nbsp;<select name="smid" id="makeupCoSe" style="width:190px; height:20px; margin:-2px;" onChange="changeF()" onblur="smidCheck()">  											
											<s:iterator value="#request.mList" var="m">
												<option value="<s:property value='#m.smid'/>"><s:property value="#m.smname"/></option>
											</s:iterator> 	 
										</select>  
									</div>
								 	<div style="margin-top:-21px;">
						   				&nbsp;<input type="text" id="makeupCo" placeholder="请选择或输入" style="width:170px; height:18px; border:0px solid #c1c1c1; outline:none; padding-left:5px;" onblur="smidCheck()">
									</div>
									<span style="font-size:12px; color:red; margin:-15px 210px; position: absolute;" id="smidmsg"></span>	
								</td>
							</tr>							
							<tr>
								<td align="right">请填写手机号码：</td>
								<td>
									<input type="text" name="cphone" id="cphone" value="<s:property value='%{cphone}'/>" placeholder="请输入手机号" onblur="cphoneCheck()" style="width:220px; height: 32px; padding-left: 5px;">	
									<span style="font-size:12px; color:red; margin-left:10px;" id="cphonemsg"><s:property value="errors['cphone'][0]"/></span>
								</td>
							</tr>
							<tr>
								<td align="right">请选择您的车：</td>
								<td>
									<select name="cidb" id="cidb" onblur="cidbCheck()">
										<option></option>
										<s:iterator value="#request.cList" var="c">
											<option value="<s:property value='#c.cid'/>"><s:property value="#c.cname"/></option>
										</s:iterator> 	
									</select>
									<span style="font-size:12px; color:red; margin-left:10px;" id="cidbmsg"></span>
								</td>
							</tr>
							<tr>
								<td align="right">请选择报险类型：</td>
								<td>
									<select name="ctid" id="ctid" onblur="ctidCheck()">
										<option></option>
										<s:iterator value="#request.ctList" var="ct">										
											<option value="<s:property value='#ct.ctid'/>"><s:property value="#ct.ctname"/></option>
										</s:iterator> 	
									</select>
									<span style="font-size:12px; color:red; margin-left:10px;" id="ctidmsg"></span>									
								</td>
							</tr>
							<tr>
								<td align="right">请选择案发时间：</td>
								<td>
									<input type="date" name="cdate" id="cdate" onblur="cdateCheck()" value="<s:date name='%{cdate}' format='yyyy-MM-dd'/>"/>
									<span style="font-size:12px; color:red; margin-left:10px;" id="cdatemsg"><s:property value="errors['cdate'][0]"/></span>	   
								</td>
							</tr>
							<tr>
								<td align="right">请填写案件地点：</td>
								<td>
									<input type="text" name="caddress" id="caddress" value="<s:property value='%{caddress}'/>" placeholder="请输入报险地点" style="width: 500px; height: 32px; padding-left: 5px;" onblur="caddressCheck()"/>						  							   
								  	<!-- <select name="caddress" id="province" onChange="huayang.district.selectProv(this.value,'',1);"></select>
								    <select name="caddress" id="city" onchange="huayang.district.selectCity(this.value,1);"></select>
								    <select name="caddress" id="area"></select>-->			
								    <span style="font-size:12px; color:red; margin-left:10px;" id="caddressmsg"><s:property value="errors['caddress'][0]"/></span>	   
								</td>
							</tr>
							<tr id="body">
								<td align="right">请上传图片：</td>
								<td>
									<input type="file" name="up.upload" />
       								<input type="button" value="添加" class="addupload" id="button"><br>
       								<div></div>
								</td>
							</tr>				
							<tr >
								<td height="100px" align="right">备注：</td>
								<td>
									<textarea rows="5" cols="68" name="cdesc" id="cdesc" style="padding:5px 5px;" onkeyup="cdescCheck()"></textarea>
									<span style="font-size:12px; color:#D84C29; position: absolute; margin: 65px 0px 0px -52px;"><span id="total">0</span>/200</span>				
									<span id="cdescmsg"></span>
								</td>
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td height="80px">
									<input type="submit" onclick="checkAll2()" style="width: 120px; height: 32px; background: #0C9; border: none; color: #FFF; font-size: 16px;"/>
								</td>
							</tr>
						</table>
					</form>
				</div>
            </div>
        </div>
        <!-- 版权信息 -->
        <div style="width:100%; height:30px; text-align:center; line-height:30px; float:left; font-size:14px;">Copyright© 中国报险网 2007-2015，All Rights Reserved</div>
    </div>
    <script type="text/javascript" src="./js/addupload.js"></script>
 	<script type="text/javascript" src="./js/case.js"></script>
 	<script language="javascript"> 
 		//省份级联
		huayang.district.initBox("province","city","area");

		//获取元素
		var txt = document.getElementById('cdesc');
		var total = document.getElementById('total');

		//输入框键盘弹起时计算字数
		function cdescCheck(){
		    total.innerHTML = txt.value.length;
	   
		    if(txt.value.length > 200){
		    	txt.style.border = "1px solid";
		    	txt.style.borderColor = "red";			
		    	var num = parseInt(txt.value.length) - 200;
		    	document.getElementById("cdescmsg").innerHTML = "<font color='red' size='1px'>您输入的文字超出了"+ num +"个字</font>";
				return false;
			}else{
		    	txt.style.border = "";
				document.getElementById("cdescmsg").innerHTML = "";
				return true;
			}
		}
	</script>
</body>
</html>
